package Demo6;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Person  {
//    @Resource(name="sweater")  //sweater是属性名
//    private Clothes clothes;
    @Resource
    private  Clothes shirt;

    @Override
    public String toString() {
        return "Person{" +
//                "clothes=" + clothes +
                "clothes=" + shirt +
                '}';
    }
}
